rm(list = ls())

library(kableExtra)
library(tidyverse)

## Load MP data

dat <- readRDS('data/syn_by_ags.rds') %>%
  sf::st_drop_geometry()

dat <- dat %>%
  top_n(wt = syn_in_gem_count, n = 10) %>%
  arrange(-syn_in_gem_count) %>%
  dplyr::select(GEN, syn_in_gem_count)

# To Tex Table 

tab_tex <- dat %>%
  kableExtra::kable(., 
                    format = 'latex', 
                    booktabs = T,
                    linesep = "",
                    col.names = c('City', 'Number of Synagogues in city'),
                    label = 'cities_syn_count',
                    caption = 'Top 10 cities by number of synagogues',
                    digits = 2) %>%
  kable_styling(latex_options = c("HOLD_position"), 
                position = "center",
                full_width = F,
                font_size = 12) 

tab_tex




